<template>
	<view class="page">

		<view class="u-flex u-padding-30 " style="position: relative;">
			<button open-type="contact" class="custom-btn"></button>
			<u-icon name="kefu-ermai" size="38"></u-icon>
			<view class="u-margin-left-10  u-font-weight">联系客服</view>
		</view>


		<view class="info">
			<view class="u-flex">
				<u-image :src="info.headimg" width="130" height="130" shape="circle"></u-image>
				<view class="u-margin-left-20">
					<view class="" v-if="info.nickname">

						<view class="u-flex">
							<view>{{info.nickname}}</view>
							<view class="u-flex"
								style="color: #666; font-size: 24rpx; padding: 7rpx 30rpx;background: #fff;border-radius: 20rpx;margin-left: 30rpx;">
								
								<image v-if="info.role==1" src="/static/renzheng.png" mode="widthFix" style="width: 40rpx;height: 30rpx;"></image>
								
								<image v-if="info.role==2" src="/static/qiye.png" mode="widthFix" style="width: 30rpx;height: 30rpx;"></image>
								
								<image v-if="info.role==3" src="/static/shangjia.png" mode="widthFix" style="width: 30rpx;height: 30rpx;"></image>
								
								<!-- <image v-if="info.role==''" src="/static/vip.png" mode="widthFix" style="width: 30rpx;height: 30rpx;"></image> -->
								
								<view class="u-margin-left-10">
									{{info.role==1?'个人':info.role==2?'企业':info.role==3?'商家':'未认证'}}
								</view>
								
							</view>
							<view v-if="info.levelLogo" class="u-margin-left-20">
								<u-image :src="info.levelLogo" width="50" height="50"></u-image>
							</view>

						</view>
						<view class="u-margin-top-10">NO:{{info.id}}</view>
					</view>
					<view v-else style="font-size: 34rpx;color: #fff;">
						<navigator url="../register/index" hover-class="none">
							点击登陆
						</navigator>
					</view>
				</view>

			</view>
		</view>


		<view style="background: #fff;width: 700rpx;margin:20rpx auto;border-radius: 20rpx;">
			<u-cell-item @click="go('/pages/drawAward/index')" title="幸运大转盘" :title-style="{color:'#3C97FF ',fontSize:'30rpx'}" :border-bottom="false"
				icon="gift-fill" :icon-style="{color:'#3C97FF ',fontSize:'30rpx'}">
			</u-cell-item>

		</view>
		
		
		<view class="u-padding-30" style="width: 700rpx;margin: auto;background: #fff;">
			<view class="u-font-weight">我的工作</view>
			<view class="myWork" >
				<!-- @click="go" -->
					<image @click="checkIdentity('/pages/issueWork/index?title='+'发布工作',2)"  src="/static/my_1.png" mode="widthFix" class="images"></image>
					<image  @click="checkIdentity('/pages/issueWork/index?title='+'找工作',1)"   src="/static/my_2.png" mode="widthFix" class="images"></image>
					<image   @click="checkIdentity('/pages/my/work',2)"  src="/static/my_3.png" mode="widthFix" class="images"></image>
					<image   @click="checkIdentity('/pages/my/man',1)" src="/static/my_4.png" mode="widthFix" class="images"></image>                              
			</view>
		</view>
		
		
		<view class="u-padding-30 u-margin-top-20" style="width: 700rpx;margin: auto;background: #fff;">
			<view class="u-font-weight">我的服务</view>
			<view class="mySerive" >
				<view>
					<u-grid :col="3" :border="false">
							<u-grid-item @click="go('/pages/myIntegral/index')">
								<u-image src="/static/serive_1.png" width="48" height="48"></u-image>
								<view class="grid-text">积分余额</view>
							</u-grid-item>
							<u-grid-item @click="personal">
								<u-image src="/static/serive_2.png" width="48" height="48"></u-image>
								<view class="grid-text">实名认证</view>
							</u-grid-item>
						<!-- 	<u-grid-item>
								<u-image src="/static/serive_3.png" width="48" height="48"></u-image>
								<view class="grid-text">个人资料</view>
							</u-grid-item> -->
							<u-grid-item  @click="go('/pages/vip/index')">
								<u-image src="/static/serive_4.png" width="48" height="48"></u-image>
								<view class="grid-text">会员中心</view>
							</u-grid-item>
							<u-grid-item  @click="go('/pages/help/index')">
								<u-image src="/static/serive_5.png" width="48" height="48"></u-image>
								<view class="grid-text">帮助中心</view>
							</u-grid-item>
							<u-grid-item style="position: relative;">
								
								<button open-type="contact" class="custom-btn"></button>
								<u-image src="/static/serive_6.png" width="48" height="48"></u-image>
								<view class="grid-text">客服</view>
							</u-grid-item>
							<u-grid-item   @click="checkIdentity('/pages/store/index',3)" >
									<u-image src="/static/serive_7.png" width="48" height="48"></u-image>
									<view class="grid-text">店铺服务</view>
							</u-grid-item>
							
							<u-grid-item  @click="go('/pages/collect/index')">
									<u-image src="/static/serive_8.png" width="48" height="48"></u-image>
									<view class="grid-text">我的收藏</view>
							</u-grid-item>
							
							
					</u-grid>
				</view>	                        
			</view>
		</view>
		
		
		<!-- <view style="background: #fff;width: 700rpx;margin:20rpx auto;border-radius: 20rpx;">
			<u-cell-item @click="go('/pages/drawAward/index')" title="加入黑名单"  :border-bottom="false"
				>
			</u-cell-item>
		
		</view> -->


	</view>
</template>

<script>
	import check from '@/common/check.js';
	
	export default {
		data() {
			return {
				info: ''
			}
		},
		onShow() {
			
			
			
			
			this.name()
			
			
		},
		methods: {
			personal(){
				if(!this.info.role){
					uni.navigateTo({
						url:'/pages/certification/personal'
					})
				}else{
					this.$u.toast('您已认证')
				}
			},
			
			
			checkIdentity(page,Identity){
				check.checkIdentity(page,Identity).then(res=>{
					console.log(res)
				})
			},
			
			
			name() {
				this.$u.api.userInfo().then(res => {
					this.info = res;
					
					
				})

			},
			go(e){
				uni.navigateTo({
					url:e
				})
			}
		},
	}
</script>

<style lang="scss">
	.page {
		background: #f6f6f6;
		min-height: 100vh;
		padding-bottom: 100rpx;
	}

	.info {
		padding: 0 20rpx 20rpx 30rpx;
	}
	.myWork{
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		.images{
			width: 310rpx;
			height: 130rpx;
			margin-top: 20rpx;
		}
	}
	.grid-text{
		margin-top: 10rpx;
	}
	.mySerive{
		
	}
</style>
